package com.qidian.k12.controller;

import com.qidian.k12.pojo.Admin;
import com.qidian.k12.service.AdminService;
import com.qidian.k12.util.K12Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 戴着假发的程序
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    @GetMapping("/checklogin")
    public K12Result checkLogin(String token){
        return adminService.checkLogin(token);
    }
    @PostMapping("/login")
    public K12Result login(@RequestBody Admin admin){
        return adminService.login(admin.getAdminName(),admin.getAdminPass());
    }
}
